package com.caigou.mapper.cms;

import com.caigou.bean.cms.entity.AdList;
import com.caigou.bean.cms.param.AdConfigParam;
import com.caigou.bean.cms.param.AdListParam;
import com.caigou.pojo.AdConfigInfoAdList;
import com.caigou.pojo.AdListHistory;
import com.caigou.pojo.AdListInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository("AdListMapper")
public interface AdListMapper {
    List<AdListHistory> loadAdListHistory(AdListParam param);

    void recoverAdListHistory(AdList adList);

    AdList loadAdListByConfig(@Param("configId") Integer configId);

    void updateAdListStatus(@Param("id") Integer id, @Param("adStatus") Integer adStatus);

    void updateAdListToDefault(@Param("configId") Integer configId, @Param("adStatus") Integer adStatus);

    int loadPublicCountByContract(@Param("contractId") Integer contractId);

    List<AdConfigInfoAdList> loadAdConfigInfoAdList(@Param("configId") Integer configId);

    int loadTimeQuantum(@Param("configId") Integer configId, @Param("startTime") String startTime, @Param("endTime") String endTime, @Param("adListId") Integer adListId);

    int loadContractQuantum(@Param("configId") Integer configId, @Param("contractId") Integer contractId);

    int saveAdList(AdList adList);

    AdListInfo loadAdListInfo(@Param("adListId") Integer adListId);

    int updateAdListInfo(AdList adList);

    AdList loadAdListById(@Param("adListId") Integer adListId);

    AdList loadAdListByConfigAndContract(@Param("configId") Integer configId, @Param("contractId") Integer contractId);

    void deleteAdList(@Param("adListId") Integer adListId);

    List<AdList> loadAdListByTask();

    AdList loadAdListByAdConfigCode(@Param("adConfigCode") String adConfigCode);

    AdList loadDefaultAdList(@Param("configId") Integer configId);

    int loadPublicCountByConfig(@Param("configId") Integer configId);
}
